package swing;

import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.EventQueue;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import javax.swing.border.EmptyBorder;

public class JTabbedPaneDemo01 extends JFrame {
	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					JTabbedPaneDemo01 frame = new JTabbedPaneDemo01();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public JTabbedPaneDemo01() {
		JFrame frame=new JFrame("welcome to mldn");
		Container cont=frame.getContentPane();
		JTabbedPane tab=null;
		tab=new JTabbedPane(JTabbedPane.TOP);
		JPanel pan1=new JPanel();
		JPanel pan2=new JPanel();
		JButton but=new JButton("按钮");
		JLabel lab=new JLabel("标签");
		pan1.add(but);
		pan2.add(lab);
		String picPath="d:/217647a8bee7c88e9efb4a11cd2b34e6_175.jpg";
		tab.addTab("图片选项", new ImageIcon(picPath),pan1,"图像");
		tab.addTab("文字选项", pan2);
		cont.add(tab);
		frame.setSize(230, 120);
		frame.setLocation(300, 200);
		frame.setVisible(true);
	}

}
